function Header(){
    this.nav_height = $(".header_nav").height();
    this.log        = $(".log")
    this.login      =$(".header_l")
    this.header     =$(".header")
    this.header_nav = $(".header_nav")
    this.search =$(".search")
    this.box    = $(".header_box")
    this.box_li = $(".header_box li")
    this.search_btn = $(".search_btn")
}
$.extend(Header.prototype,{
    init:function(){
        $(window).on("scroll",$.proxy(function(){
            var scrollTop = $("html,body").scrollTop();
            this.scroll(scrollTop);
        },this))
    },
    scroll:function(scrollTop){
        if(scrollTop >= this.nav_height){
            this.log.css({
                position : "absolute",
                bottom      : 0,
                left     :0,
                "z-index" :15
            })
            this.login.css({
                position :"absolute",
                bottom:0
            })
            this.search.css({
                display : "none",
            })
            this.header_nav.css({
                display : "none",
            })
            this.box.css({
                height : "50px",
            })
            this.box_li.css({
                "line-height" : "50px"
            })
            this.header.css({
                position:"fixed",
                top    : 0,
                "z-index" :11
            })
            this.search_btn.css({
                display : "block",
                "z-index" :12
            })
        }else{
            this.log[0].style.cssText = ""
            this.login[0].style.cssText = ""
            this.search[0].style.cssText = ""
            this.header_nav[0].style.cssText = ""
            this.header[0].style.cssText = ""
            this.search_btn[0].style.cssText = ""
            this.box[0].style.cssText = ""
            this.box_li.css({
                "line-height" : "70px"
            })
        }
    }
})
export default new Header();